Method of and apparatus for code communication



July 23, 1968 R. WERNIKOFF ET AL 3,394,352

METHOD OF AND APPARATUS FOR CODE COMMUNICATION Filed July 22, 1965 8 Sheets-Sheet 1 c; IA Co Ck 'x ux n C L--- INFORMATION SOURCE INC IOMINC $OURCE SEQUENCE FIG. IB

lA/VE/VRMS ROBERT WERNIKOFF PAUL EPTEIN WILLIAM FSCHRIBER ATTORNEYS y 3, 1968 R. WERNIKOFF ET AL 3,394,352

METHOD CF AND APPARATUS FOR CODE] COMMUNICATION Filed July 22, 1965 8 Sheets-Sheet 2 c (NULL cooeu) ck FIG. 2

@woou 20E B002) .5330 H6 502:2

k J n 0 C H C vm c a l lllllll I. B 5/ X 0 B M u :1 ND E R T w MK .7 UI i l l Ill lllpw m D o 555E P EN M H 1 D Aws I OmmU LNCA 4 5 ||m |m|||||||||||| 4 1 x 02.5mm. fit,

Sow-fa bah- 6 m0 Emmi-J2 FIG?) INVENTORS ROBERT WERNIKOFF' PAUL EPSTEIN WILLIAM F. SCHRIBER 0y MM m A'ITMNEVS July 23, 1968 R. WERNIKOFF ET AL 3,394,352

METHOD OF AND APPARATUS FOR CODE CUMMUNICATION Filed July 22, 1965 8 Sheets-Sheet :5

33k uwmh5m LOHm m mm FIGURE 4- ZOFFUwJMw JOEPZOU MOP/E520 506 mu 50 32m lAM SCHREIBER mvsmolzs: ROBERT \X/ERMKDFF DAUL EDSTEN Wt A mum;

July 23, 1968 R. WERNIKOFF ET AL 3,394,352

METHOD CF AND APPARATUS FOR CODE COMMUNICATION 8 Sheets-Sheet. 4

Filed July 22, 1965 S LECT OUTPUT POSITION TRAN5WTTER vmreuwu Kim .5nE6 wuzwzoww s S08 M 963 2055K; m B W 1 M H rm m E M M m w w 4..

FIGURE 4A m R 0m R M TI 1 W m RIC WEESWW IWWF A Mi E M wmmy Rmw7 y 23, 1953 R. WERNIKOFF E AL 3,394,352

METHOD OF AND APPARATUS FOR CODE COMMUNICATION Filed July 22, 1965 8 Sheets-Sheet 5 Zoo UD. WORD DET ECTOR $YMBOL COUNTER D MODE DETECTOR INPUT BUFFER RECM'TER DECODED SYMBOL OUTPUT FlGURE 4B INVE NTORS ROBERT WERNIKOFF PAUL EPSTEIN WILLIAM F. SCHRIBER 3k, WMV W'W ATTOENEV;

July 23, 1968 R. WERNIKOFF ET AL 3,394,352

METHOD UP AND APPARATUS FOR CODE COMMUNICATION Filed July 22, 196's 8 Sheets-Sheet 8 4 r0 5* LL! 0 LL LL 0 g 1'') LULL E? F.- l m 5 5 1 2 a) a. Q 8 O\ 0 v c. 1% U N ug 3 8 2 '5 a 8 1' n 2 In Ed 2% .1 0 2% U20 UJ 2! z mu oiuoa z -o sg i222 E a m/z z/vrofif 2 ROBERT WERNIKOFF PAUL EPSTEIN WILLIAM F. SCHRIBER BY 1 4 M1 *fw ATTOR/VEVS United States Patent 3,394,352 METHOD OF AND APPARATUS FOR CODE COMMUNICATION Robert Wernikoff, Cambridge, Paul Epstein, Brookline, and William F. Schreiber, Lexington, Mass., assignors to Electronic Image Systems Corporation, Boston,

Mass., a corporation of Massachusetts Filed July 22, 1965, Ser. No. 474,189 35 Claims. (Cl. 340172.5)

ABSTRACT OF THE DISCLOSURE The methods and apparatus disclosed minimize the number of symbols to be transmitted, and hence the transmission time, in a communication system, by determining the most efiicient code for encoding sequences of message symbols and transmitting the symbols in that code. Determination of the most efficient code can be accomplished by applying the message symbols to a plurality of encoders, counting the numbers of symbols of coded representations of successive message symbols produced by each encoder, and comparing the numbers to determine the particular code that introduces the smallest number of symbols of coded representation consistent with distortionless message transmission. Tagging symbols are transmitted to permit reconstruction of the original message symbols from the transmitted coded symbols. In an application of the invention to facsimile transmission run-length coding is employed.

The present invention relates to methods of and apparatus for code communication, being more particularly, though not in all cases exclusively, directed to efiicient coding for inhomogeneous sources of information.

The problem of processing information-t-o-be-communicated so as to enable a minimum number of symbols to be transmitted with reliable recovery of the information has long challenged the art. In devising his telegraphic code more than a century ago, Samuel F, B. Morse generally assigned the shortest code symbols to the most frequently used English alphabet letters in order to economize on the transmission time of messages. Had Morse optimized the assigning of the shorter code symbols to the more frequent letters, this would have produced about a fifteen percent saving in transmission time over assigning symbols of equal length to all letters. Far greater saving, however, could have been effected by assigning code symbols, not for individual letters, but for pairs, triplets or other grouping of letters that in normal text occur much more frequently than others. Within recent years, indeed Claude Shannon has estimated that the maximum saving in trans mission capacity that can be obtained through optimum ecoding of English text is about seventy-five percent when statistical dependences between successive letters of text, carried out to one hundred letters, are considered.

When the symbols issuing from the information source are statistically dependent upon one another, so that certain groupings of symbols occur more frequently than others, efficient coding requires that the symbols be considered not singly but in groups. The number of elements of which the group must consist is dictated by the range of substantial statistical dependence. It might amount to ten or twenty letters in English text, and to several thousand bits in pictorial transmission. The size of the code book in which groups of source symbols are assigned code symbols increases fantastically as the group is made larger (the number of entries in the code book is 27 :205,900,OO0,00O,0O0 for groups of ten English letters, and it is the square of that number for groups of twenty letters) and this growth soon becomes an insurmountable practical limitation to optimum coding. There ice are no non-singular codes that circumvent this problem.

An optimum code is matched as closely as possible to the statistical peculiarities of the population or set of sequences to be encoded. A code designed to match the letter frequencies of English text, for example, becomes quite inefiicient when it is applied to a different population or set of sequences, such as a foreign language. Whenever dissimilar populations are mixed (for example, for the purpose of obtaining a single set of letter frequencies applicable to English and to a foreign language simultaneously) the frequencies of the letters tend to equalize; and any operation on sequences that equalizes probabilities reduces the possible compression, In the limit, indeed, if an information source is as likely to produce one symbol as another, and if successive symbols do not depend on previous ones, then no compression whatsoever is possible. The reduction of transmission time by means of coding is thus possible only to the extent that the statistics of the strings of symbols produced by information sources diller from independence and equiprobability. The recipe for the optimum code is fixed in a deterministic, mathematical way by the precise probability distributions that describe the information source.

While it is difiicult to reconcile language text, television, moving pictures, facsimile, telcmetered data, etc., with the mathematical idea of a homogeneous population with a fixed, immutable and known frequency distribution, yet this abstract concept underlies all prior coding theory.

In accordance with Shanllons theorem, an information source is contemplated that produces sequences of symbols (but not just any sequence) that may be regarded as random samples from a homogeneous population with known and immutable frequency distributions of all orders (i.e., for pairs of symbols, triplets, n-tuples). The term "homogeneous (the technical word is ergodic") implies that any sufiiciently long sequence from the source is very likely to be representative of any other source sequence,

Adherence to this framework has, however, resulted in prior-art coding and compression systems that fall far below the ultimate transmission efficiency. The reason is that the mathematical framework on which they are based does not sufliciently resemble reality. In accordance with the present invention, on the other hand, as pragmatically determined from actual experiment. it is not assumed that the population of symbols (letters of text, or elements of television or facsimile pictures, for example) is a homogeneous source in the sense of information theory; but, rather, that inhomogeneous sources are involved requiring a novel coding logic that has been found in practice to more than double the average compression attained by prior-art systems implementing conventional coding theory, and with less equipment. In addition, the coder for inhomogeneous sources, underlying the invention, results in a transmission time that never exceeds the uncoded time and sometimes is fifty times smaller.

An object of the invention, thus, is to provide a new and improved method of and apparatus for code communication that is not subject to the above-described disad antages of priorart coding and compression systems, predicated upon conventional coding theorems; but that, to the contrary, provides for greater transmission-time efficiency and with less complicated and costly apparatus.

A further object is to provide a new and improved scanning transmission and reception system for such purposes as facsimile or other communication, all generically referred to as picture" scanning and the like.

Still another object is to provide each of a novel code transmission and reception apparatus.

Other and further objects will be made apparent hereinafter and are more particularly pointed out in the appended claims.

The invention will now be described in connection with the accompanying drawings, FIG. 1A of which is a schematic block diagram of a portion of a transmitter useful with the invention;

FIG. 1B is a graph illustrative of the performance of the system of FIG. 1A;

FIGS. 2 and 3 are similar graphs of modified performance;

FIG. 4 is a block diagram of a preferred generic encoding and transmitting system embodying the invention;

FIG. 4A is a block diagram of the output formatting system of FIG. 4;

FIG. 4B is a similar diagram of a preferred generic decoding or receiving system for use with the transmitting system of FIG. 4, FIGS. 4, 4A and 4B, as a unit, together constituting a complete system employing the invention;

FIGS. 5 and 5A are block diagrams of the transmitting and receiving sections, respectively, of a preferred facsimile or similar scanning system using the novel techniques of the invention as a species of the generic concept of FIGS. 4, 4A and 4B; and

FIG. 5B is a circuit modification that may be employed with the system of FIG. 5.

Considering for purposes of illustration an information source that produces sequences drawn not necessarily from one homogeneous population, but possibly from several different populations, some known and others perhaps not yet identified, and considering that the source may switch from one population to another at random. and without stopping; that the different populations are used in unknown, and maybe even in variable proportions; and that switching from one population to the next occurs at random times, an example of the method underlying the present invention may be constructed as follows. For purposes of illustration only, it may be considered that this operation occurs when different-language messages are successively transmitted from United Nations Headquartcrs.

Since it is known how to gain a useful compression in any one language (or, more generically, population), it is proposed to construct an apparatus that effectively has a collection of encoders, one matched to each language (or population). Then, as the source switches around from one language (or population) to the next, the apparatus automatically follows and, at each instant, uses the code best suited to the output of the source. Each time the coder switches codes, it sends a special signal to the receiver indicative of the code of the following message, so that the receiver can apply the corresponding decoding procedure and recover the original message. The problem is, however, to enable the coder to determine when the source switches populations. The coder must determine this as soon as possible, so that it may switch codes promptly before any great loss in transmission efficieucy has been incurred.

What makes the problem difiicult is that the conditions of this oversimplified illustration, in which it is possible to think of the source as switching around among a finite and definite number of discrete populations, are not often realized in practice. It is more usual to find real sources changing their behavior in a continuous way, and to find the statistics of the corresponding source sequences assuming a continuum of values; thus there does not exist, even in principle, a unique, well-defined time at which codes should be switched. The present invention provides the solution both for the simple case of switching among discrete sources and for the more important and realistic case of gradually changing source statistics; but the method and apparatus of the invention are more clearly understandable if initially described in terms of the simpler case.

Since it is not known which population the source is currently drawing its sequence from, according to the present invention, the message sequence from the information source is fed simultaneously to all encorders. Thus, in FIG. IA, the sequence of information source symbols x x x is shown fed from the source S to each of the different encoders or coders C C C C In view of the fact that all possible source populations are not known, it is useful to include one encoder C that performs pure, uncoded transmission; its output is identical with its input. We shall call this the null encoder. As each successive source symbol enters a given encoder, the encoder output (which may differ from all the rest) will be of several difierent types. The output may be no symbols (if that particular code works on blocks or source symbols, and the end of the block hasn't been reached yet); or it may be one symbol (as in the null encoder C and others); or it may be many symbols (as in a coder that has reached the end of a block or of a run of source symbols). In FIG. 1B, accordingly, there are plotted the numbers of symbols issuing from each coder as successive source symbols enter it from the source S.

If the population statistics are truly stationary, each coder wiil be characterized by an average straightline behavior whose slope w determines the compression (or expansion) produced by that code. The null encoder C has unit slope if the input and output alphabets are the same, because it puts out one symbol for each successive input symbol. If the input and output alphabets are difiercut, the one at the input having A, letters and the one in the output A letters, then the previous statement is still correct after all ordinate values have been divided by log A llog A In the sequel, it is tacitly assumed that the alphabets are equal or that the indicated normalization has been done, particularly since a change in alphabets does not change the channel capacity required for message transmission and hence does not affect efiiciency.

Coder C in FIG. 1A may, as an illustration, produce on the average fewer symbols than enter it; thus, it produces a characteristic shown in FIG. 1B of slope w l. Coder C on the other hand, may produce on the average more than one symbol per input symbol, producing a slope w 1. These statements apply to the average behavior of the coders, shown as the dash lines in FIG. 1B. The actual number of output symbols put out by each coder for each input or arriving source symbol is, of course, a random variable Whose value depends on the specific source symbol that entered the coder (these symbols are themselves random variables) and on the source symbols that entered the coder earlier. The actual number of symbols issuing from each coder, as represented by the solid lines in FIG. 18, thus, is a random walk or step-curve about which the most that can be said, in general, is that it is monotonic nondecreasing.

When the source S abruptly switches populations, so that the source sequence has entirely different statistics, the dash-line curves of FIG. 113 that describe the average behavior of the coders will abruptly change slope, since a coder which formerly was quite effi-cient (w l) may now be very inefiicient (w l). Automatic code-switching can be based on detecting changes in slope in the average behavior of the coders (i.e., the ratio of output to input symbols or the number of output symbols per unit of real time) and such operation in the system of the invention is for some purposes feasible; but it is preferred, because the average behavior is not known with any acceptable accuracy unless the source persists in its new behavior for a very long time, not to rely upon mere slope detection. What is really available, as opposed to merely assumed, is the actual output from each coder; i.e., the solid-line step curves of FIG. 1B. The randomness of these curves makes the measurement of slopes unreliable, and masks the precise point at which the switch in populations occurred; and there is, in fact, no such point with real sources, whose population parameters change gradually, rather than abruptly. Thus any code-switching systems based on slopes or other population averages, such as entropy, would at best merely be crude approximations.

In accordance with the preferred form of the present invention, therel'orc, the code-switching logic is based, not on abstract constructs like average slopes or on unsupported assumptions about physical sources, but on the final goal of the coding system, which is to transmit as few symbols as possible without distorting the information produced by the source. Attention is thus focussed on the symbol counts at the outputs of the encoders; and at any given time, that encoder is chosen which leads to the fewest transmitted symbols. This operation can be implemented in a manner now to be described.

Each time the transmitter S switches codes, it must convey this fact to the receiver; that is, the transmitter must tell the receiver which code it will be using next. The accomplishment of this function requires transmitting a few symbols, representative of the name of the new code. If the transmissions are in binary alphabet, then it takes one symbol to identify one out of two possible codes; two symbols to identify one out of four possible codes; three symbols for eight possible codes; and so on. Each additional symbol doubles the number of codes that can be identified. With a quaternary alphabet, one symbol identifies one of four codes; two symbols, one of sixteen codes; and so on. Each additional symbol quadruplcs the number of codes that can be so identified. Since, in most applications, it is unlikely that a practical system would have more than a dozen or two different codes, it never takes more than three or four symbols to identify the new code. The receiver, however, is confronted with a continuing stream of symbols and it will not be able to distinguish between ordinary message symbols and code-switching instructions unless special provision is made to provide such instructions in an unambiguous manner. This may be done by inserting in the message stream a uniquelydecipherable tagging word which is the same in all codes and which informs the receiver that the immediately following symbols define the new code. To effect this requires a few symbols, say ten or so. The switching signal, therefore, may consist altogether of fifteen symbols or so, this being short c0mpared with most intervals or source homogeneity. Since some transmission time is consumed by sending instruction or tagging words, however, the number of transmitted instruction or tagging symbols must be noted.

In fact, in accordance with the invention, it is the transmission cost of the instruction or tagging symbols that supplies the discriminant for the code-switching decision; that is, codes are switched precisely then, when what is saved in transmission cost by replacing the old code with a new one just exceeds the cost of sending the instruction or tagging word that announces the change.

Assume that the information source S is allowed to feed source symbols to the encoders, as in FIG. 1A, and that there are buffers, later described, inserted between the encoders and the transmitter output so that time is af forded before a decision is made as to which coder output is to be transmitted. As successive source symbols x x etc., enter the coders, the number of symbols coming out of each coder is counted, presenting an output that, if plotted, is of the type shown in the graphs of FIG. 18. if, for purposes of explanation, the graphs are temporarily thought of as smooth lines, as shown in FIG. 2, rather than as random walks or steps, then, as the source symbols x x etc., enter the coders C C etc., the graphs representive of output symbol counts will begin to diverge from each other. If com pression is at all possible, one or more coder lines (for example, C in PEG. 2) will be below the null-coder line C so-labelled.

Assume that, as a convention, the receiver always presupposes that transmissions commence uncoded (i.e using the output from C unless the very first received word is a code-instruction or tagging word. The transmitter, before sending anything, first examines the outputs from the various coders as they enter the later-described buffers that precede the output register, with the following objective.

in the source sequence .r .r source-subscript or is sought such that for some k. where H is the number of tagging symbols that must be transmitted to change codes, A (initially zero) is the number of source symbols that already have been transmitted, and C (x,, x,) is the number of symbols that must be transmitted by coder C to represent all source symbols starting with x and ending with x,,. It costs H symbols to start transmitting in C instead of C but, if the first on source symbols are transmitted with the C code, then a minimum of 2HH=H symbols are saved. Even at x, the line for C veers up sharply and C begins to cost more than C per unit input symbol, therefore, the transmitter can switch back to C (an operation that costs another H symbols) and still not have lost anything with respect to uncoded transmission.

Thus, the code-switching logic of the invention issues a command that initiates transmission of a code-instruction word identifying C and of those symbols in the C output buffer which correspond to the first a source symbols. While transmission is taking place, the codeswitching logic allows enough new source symbols to enter the coders so that the logic can decide what code to use next before the transmitter has finished sending the symbols of the previous block. The object here is to keep the transmission line fully loaded at all times. This requirement defines the minimum computation rate for the switching logic, and it also defines the rate at which source symbols must be supplied to the coders.

To decide what code to use in the next step, it is noted that the cumulative number of symbols that the coders would have sent for the first a source symbols is now quite immaterial. What matters is how many symbols per source symbol they produce from x, on. There is subtracted from each line of FIG. 2, therefore, its value at x resulting in the graph of P16. 3.

Now the system is initially in the C code, A has assumed its new value, and the system will stay with this code unless a new a is reached such that etc., the smallest If this happens, the system transmits the symbols between x, and x, in code C,-. If this does not happen before the C output buffer fills up, then transmission continues in code C The C butter is emptied, all the other buffers are cleared, and the above procedure is repeated with all the coder output lines now originating from that source symbol which would have caused the C buffer to overflow if the system had not just then stopped the search procedure.

The method of code selection outlined above is simple and effective, but it occasionally results in a transmission cost higher than what is incurred with uncoded transmission. A preferred method of code selection that never results in transmitting more symbols than are required for uncoded transmission might be tabulated as follows:

Coder logic when discriminant equals 2H Let M represent the maximum capacity of coder buffers.

Step 1.Thc value of A is initially zero as is the value of i in Steps 2, 5 and 7. Proceed to Step 2.

Step 2.Search for the smallest source sequence subscript on such that conditions (3) and (4) are both satisfied for some values of k:

If no such value of a is found, proceed to Step 7; otherwise proceed to Step 3.

Step 3.Using the a value and k value found in Step 2,

determine whether or not condition (5) is satisfied:

km s oot. i H

If condition (5) is satisfied, proceed to Step 4; otherwise proceed to Step 5.

Step 4.Using the a value and k value found in Step 2, transmit a code-instruction word, transmit the next a source symbols in code C set the value of i in Steps 2, 5 and 7 equal to the value of k and proceed to Step 9.

Step 5.--Using the a value found in Step 2, determine whether or not condition (6) is satisfied:

l \1 a) O( M a) If condition (6) is satisfied, transmit the next a source symbols in code C, and proceed to Step 9; otherwise proceed to Step 6.

Step 6.Transmit a code-instruction word for code C transmit the next a source symbols in code C set the value of i in Steps 2, and 7 equal to Zero and proceed to Step 9.

Step 7.Determine whether or not condition (7) is satisfied:

If condition (7) is satisfied, transmit the next M source symbols in code C and proceed to Step 9; otherwise proceed to Step 8.

Step 8.Transmit a code-instruction word for code C transmit the next M source symbols in code C set the value of i in Steps 2, 5 and 7 equal to zero and proceed to Step 9.

Step 9.Set the value of A equal to the total number of source sequence symbols that have now been transmitted. Proceed to Step 2.

Using 2H, rather than H, as the discrimination level is ultra-conservative; its virtue being that it allows lossless return from any code to C in case it turns out, in the interval following the decision interval, that the chosen code and all the other codes suddenly become more inefiicient than uncoded transmission. Another way to obviate this danger is to monitor the interval following the de cision interval before making a firm decision. When this is done, the discrimination level can be lowered from 2H to H without comprising the property that the system of the invention never transmits more inefficiently than uncoded.

The requisite steps for this operation may be tabulated as follows:

Coder logic when discriminant equals II Let M represent the capacity of the coder buffers, and, as before. let C (x .r,,) be the number of symbols that must be transmitted by the kth coder to represent all the source symbols starting with x, and ending with x,. The object of the following logic is to identify that coder whose use results in the fewest transmitted symbols. Occasionally it will happen that two or more coders result in equally few transmitted symbols for a particular segment of source symbol sequence; the logic then selects a specific coder by applying some arbitrary rule to resolve the ambiguity, an example of such a rule being, choose that coder whose subscript k is least. Any number of other rules are admissible. In the coding logic presented here, occasional use is made of the term, the preferred value, relative to A and a, of a set of values of It, which term is defined by the following rule: from among the set of coder subscripts k find the subset for which C tx x is least; from among the subset of values thus found, find the least value of k.

Step 1.--The value of x, the total number of source sequence symbols that have been transmitted, is initially zero. Proceed to Step 2.

Step Zr-Scarcli for the smallest source scqucucc sub script :1 such that conditions (8) and (9) are both satisfied for one or more valucs of :t:

If no such value of a is found, proceed to Step 3; otherwise proceed to Step 5.

Step 3.Transmit M source symbols in C Proceed to Step 4.

Step 4.-Set the value of x equal to the total number of source sequence symbols that have now been transmitted. Proceed to Step 2.

Step 5.Using the value of (1 found in Step 2 and using the preferred value, relative to x and a of the set of values of It found in Step 2, transmit a code-instruction word, transmit the next a source symbols in C and set the value of i in Steps 7, 8, 9, l2 and 13 equal to the preferred value of h. Proceed to Step 6.

Step 6.Set the value of equal to the total number of source symbols that now have been transmitted. Proceed to Step 7.

Step 7.-Search for the smallest source sequence subscript a such that conditions (10) and (ii) are both satisfied for one or more values of It:

If no such value of St is found, proceed to Step 8; otherwise proceed to Step 9.

Step 8.-Deterrnir.e whether or not condition (l2) is satisfied:

l fl'u 1\r)i u 1i- M a r) If condition (12) is satisfied, transmit the next M source symbols in C and proceed to Step 6; otherwise transmit a code-instruction word for C transmit the next M source symbols in C and proceed to Step 4.

Step 9.Using the value of or found in Step 7, search for the smallest source sequence subscript ,H such that conditions (13) and (l4) are both satisfied for one or more values of k:

kl-w l d-m a If no such value of ti is found, proceed to Step 11; otherwise proceed to Step 10.

Step 10.Using the value of 5 found in Step 9 and using the preferred value, relative to x and B, of the set of values of It found in Step 9, determine whether or not condition (15) is satisfied:

C (.r,, .r )g(. (.r,, .i',,}--I1 (l5) If condition (15) is satisfied, transmit a code-instruction word for C transmit the next ,3 source symbols in C set the value of i in Steps 7, 8, 9, l2, and 13 equal to the preferred value of It and proceed to Step 11.

Step 11.-Using the value of or found in Step 7 and using the preferred value, relative to and a, of the set of values of It found in Step 7, search for the smallest source sequence subscrip 6 such that conditions ([6) and (17) are both satisfied for one or more values of j:

if no such value of 5 is found, proceed to Step 13; otherwise proceed to Step 12.

Step 12.If the value of i is among the values of j found in Step ll, proceed to Step 13; otherwise proceed to Step 14.

Step J3.Using the value of (1 found in Step 7, determine whether or not condition (18) is satisfied llcondition (18) is vsatislictl, transmit the next u source symbols in code C, and proceed to Step 6; otherwise transmit a code-instruction word for C transmit the next or source symbols in code C and proceed to Step 4.

Step 14.--Using the value 6 found in Step 11, the value of or found in Step 7 and the value of k used in Step 11, and using the preferred value, relative to and 5, of the set of values of j found in Step 11, determine whether or not condition (19) is satisfied:

If condition (19) is satisfied, proceed to Step 16; other wise proceed to Step 15.

Step 15.Using the value of k and the value of a used in Step 11, determine whether or not condition (20) is satisfied:

H JS tJU M tz) 1f condition (20) is satisfied, transmit a code instruction word for C transmit the next a source symbols in code C set the value of i in Steps 7, 8, 9, l2, and 13 equal to the value of k and proceed to Step 6; otherwise transmit a code instruction word for C transmit the next a source symbols in code C and proceed to Step 4.

Step 16.-Using the value of j and the value of a used in Step 14, determine whether or not condition (21) is If condition (21) is satisfied, transmit a code instruction Word for C transmit the next or source symbols in code C set the value of i in Steps 7, 8, 9, 12, and 13 equal to the value of j, and proceed to Step 6; otherwise trans mit a code instruction word for C transmit for the next a source symbols in code C and proceed to Step 4.

The reason for including conditions of the form exemplified by (8), (l0) and (13) is that the code-selection decision cannot be delayed indefinitely because the buffers at the outputs of the coders must, in practice, be constructed out of physical elements and will thus have a finite and definite maximum capacity. The efiiciency of the decisions which are forced by imminent buffer overflow can be increased by reading out of the butlers (into the transmitter output register) groups of symbols smaller than the full block of M symbols, but the improved elliciency is gained at the expense of great equipment complexity.

The coding systems described in the sequel are more complicated than the logic described above because coders often produce outputs intermittently, in blocks of symbols, rather than giving an output for each input symbol (run-length coders, for example, behave in this manher) and different coders may give their outputs at different times. Since the time at which a code is chosen will not usually coincide with the last output time of the chosen code, the beginning of the next decision interval must be moved back to where that coder gave its last output. Thus, to restart the system, there must be available some source symbols that occurred in the past, which implies the use of an input buffer, as later explained.

The appropriate logic is hereinafter presented with reference to the block diagram of FIG. 4. For purposes of simplified illustration, the system of FIG. 4 is based on a 2H discrimination level, though it is possible to base the same on H and other arrangements of greater complexity and to base the same upon clearing output buffers by individual symbols rather than by blocks of symbols, as well.

Since the individual components used in FIG. 4 are so Well known and conventional in computer and coding systerns, specific forms of coders, counters, buffers, comparators, code generators and shift registers and the like are not illustrated; it being readily obvious to those skilled in this art that the method underlying the invention may be practiced with many forms of such building blocks and that a principal feature of novelty resides in the concept of the method steps involved.

Referring to FIG. 4, the source of message symbols S is shown applying the same by conductor 2 to the beforemcntioned input butler 4, of any conventional type, that, when filled, transmits a stop signal to the source S via path 6, :as is well known. Suitable apparatus for this purpose in, for example, the case of a binary source S, may be the Digital Equipment Corporation Type 4223 buffer registers connected with the Type 4215 counters for generation of stop signals, as described, for example, on pages 6.17 through 6.21 of System Modules (C-lOO), published in 1964 by the said Digital Equipment Corporation of Maynard, Mass. Clearly, other types of well-known buffer apparatus may also be used.

The input symbol index 33 controls the passage of source sequence symbols from the input buffer 4 via conductors 34, 34' 34* corresponding to each symbol stored in the buffer 4, to the coders C C C C via conductor 35. Suitable apparatus for this purpose in, for example, the case of a binary source S, may be the Digital Equipment Corporation Type 4111 gates for symbol selection as described, for example, on page 6.2 of the said System Modules text and the Type 4215 counters for designation of the symbol to be selected as described, for example, on pages 6.17 through 6.21 of the said Systems Modules text. The total number of input symbols from the input symbol index, moreover, is counted in the counter 10.

The input symbol index 33 accepting the message symbois from input buffer 4 simultaneously feeds the different encoders C (the null coder) C C C as in the embodiment of FIG. 1A, with the respective outputs thereof applied, as previously suggested, to output butters BUF BUF; BUF BUF such as of the type described in connection with input buffer 4. The encoders may each be of any desired conventional type, being a device that accepts a sequence of symbols and produces another sequence at its output in accordance with some fixed rule. The simplest kind of coder is one that performs translation from one alphabet to another. An example is a teletypewriter to which a stream of English letters is fed (by depressing the corresponding keys in sequence) and from which a sequence of off/ on pulses issue, with specific combinations of seven pulses representing each input symbol. The coders of principal interest in connection with the present invention are those in which the translation rule that governs them profits from known peculiarities of the input sequence to reduce the time-bandwidth product required for transmission of the output sequence. Many examples are extant, of which two of the earliest are given by Vernam et a]. (US. Patent No. 1,851,072) and by Watson (US. Patent No. 2,115,894). The translation rule, or code, described in the references is called run-length coding. It is suitable for binary sequences such as might be obtained by facsimile scanning of black-andwhite copy, in which one symbol (say that representing white) occurs much more frequently than the other (representing black). In such cases, transmission time can be economized by transmitting, not a long sequence of whiterepresentative symbols, but merely the number of such symbols that occur in an uninterrupted sequence, or run. The corresponding embodiment is nothing more than a counter.

Another well-known code is the so-called Shannon-Fano Code, described, for example, by C. E. Shannon in The Mathematical Theory of Communication, University of Illinois Press, Urbana, 1949, page 29. A possible coder embodying this code is described in US. Patent No. 2,909,601 to Fle-ckenstein et al. Many other codes and embodiments thereof are described by B. M. Oliver, Efiicient Coding, Bell System Technical Journal, July 1952, pages 724-750; and in Schreiber and Inouye, US. Patent No. 2,963,551.

The encoders also provide event markers (indications showing that the respective code words have been produced) at the times that the respective code words are produced, and the respective event markers are applied to input marking registers SC SC, SC SC so that the counts of input symbols in counter at the times of the event markers may be received via conductor 36 and stored in the respective input marking registers. The input marking registers may be of any desired conventional type such as, for example, the said Digital Equipment Corporation Type 4219 jam buffer register described on pages 6.24 and 6.25 of the said Systems Modules text. The encoders further provide outputs 0", 1 k n which indicate the number of symbols in the code words produced by the respective encoders and which are applied re spectively to output marking counters TC TC TC TC so that the total number of symbols in the code words produced by the respective encoders since the beginning of the current decision interval may be counted by said output marking counters. Said output marking counters are, moreover, adapted to receive signals applied by conductor 40 which increment said output marking counters. Said output marking counters may be of any desired conventional type such as. for example, the said Digital Equipment Corporation Type 4215 complementing flip-flops described on page 6.17 of the said Systems Modules text. A fixed voltage source 41 applies a multiplicity of voltages respectively indicative of the number of symbols which may be stored in the output butters BUF BUF BUF BUF to comparator control 8, of any desired conventional type such as, for example. a rnultiplicity of the said Digital Equipment Corporation Type 4215 counting and storing circuits and comparator gates Type 4141, described on page 6.5 of the said System Module text. The input marking registers SC 8C SC SC are provided with respective connections 0", 1" k" n" to another input of comparator control 8 to apply respective counts of input symbols to comparator 8. The output marking counters TC TC TC TC are provided with respective connections 0', 1" k' n to still another input of comparator control 8 to apply respective counts of output symbols to comparator control 8.

A clock 42 of any desired conventional type, such as, for example, the said Digital Equipment Corporation Type 4401 variable clock described on page 6.36 of said Systems Modules text, applies high frequency timing pulses to comparator control 8 and another clock 43 ap plies low frequency timing pulses to comparator control 8 at a rate suitable for transmission of output symbols.

Each output buffer BUF BUF, BUF BUF is also connected respectively at 0, 1 k n to the output formatting system later described. Selection of the appropriate buffer is effected by the respective output conductors 0"", 1" n"" from the comparator 8. The schematic showing of the last-named conductors is intended to represent conventional gating selection connections, such as, for example, are described on page 6.8 of the said Systems Modules text. The output formatting system 15 is adapted to receive from comparator 8 a strobe signal via conductor 14, an output position selecting signal via conductor 24, a designation of selected code signal via conductor 26, and shift command pulse via conductor 25. Symbols are removed from the output formatting system 15 via conductor 30 for transmission by any desired communication technique.

Referring to FIGURE 4A, a block diagram of the output formatting system 15 of FIGURE 4 is illustrated. Conductors 0', 1 k n are shown respectively applying the gated outputs 0, l k n of output buffers BUF BUF BUF BUF of FIG. 4 to an output shift register 12, of any well-known type which may, for example. embody Digital Equipment Corporation Type 4221 shift registers, described on page 6.21 of the said System Modules text. A code-name generator 16 generates the instructional or tagging word for the selected code, in accordance with the designation of selccted code signal conveyed to said code-name generator via conductors 26 and 26'. The code-name generator may assume the form. for example, of a plurality of fixed volt ages applied to the Digital Equipment Corporation Type 4127 gates described on page 6.8 of the said Systems Modules text, or other conventional circuits. The strobe signal on conductors 14 and 14' causes the instructional or tagging word to be applied to output shift register 12 via conductors 18, as is well-known.

The output of the shift register 12 may be fed either by way of a standard output 2% or an alternate output 21 connected to corresponding position contacts of an output position switch 22 the orientation of which is controlled by an output position selecting signal applied by conductors 24 and 24'. A conventional shift command pulse is applied by conductors 25 and 25 to control the shift register 12, as is well-known.

it is now in order to explain the operation of the system of FIG. 4 and the production of the previously described novel results of the invention obtained thereby. Let .r for kit). 1 ll represent the input symbol last encoded by encoder C to produce the last code word produced by encoder C Let A represent the capacity of output buller BUF for k::(), i n and let B be the greatest number of symbols which may be stored in output butter BUF, for [t -:0, l )1 such that subsequent addition of the longest word which can be produced by encoder C to those words already stored in output buifer BUF will not cause that buffer to overflow. Let the subscript 1 denote the code selected during the decision interval preceding the current decision interval; in the initial decision interval, i is to be regarded as equal to zero.

Input symbols .t', an, etc., where is the value before discussed, stored in the input buffer 4 are selected by the input symbol index 33 and are permitted to pass to the encoders C C .C .C As each encoder, for example C produces a code word, that code word is sent to corresponding output buffer BUF sufliciently rapidly that no new input symbol meanwhile is applied to encoder C the count in corresponding output marking counter TC is increased with like rapidity by an amount equal to the number of symbols in the code word produced by encoder C and an indication is sent to corresponding input marking register SC so that the number stored in input symbol counter 10 at the time at which the C output occurred may also be stored in input marking register SC The count stored at any given time in the input marking register SC is given by the expression for k:(], l n. The count store at any given time prior to code selection in the output marking counter TC, for 1::0. l I1 is equal to C tr x the number of symbols produced by encoder C to represent all source symbols starting with x, and ending with X0.

Using the outputs of the fixed voltage source, the input marking registers and the output marking counters, comparator 8 determines whether or not the expressions are satisfied, where H is the value before discussed. if expressions (25) and (27) are both satisfied, operation continues until expression (24) satisfied and expressions (23), 1'26), (28). (29) and (30) are all satisfied for one or more values of k. If there is more than one such k value, the ambiguity is resolved by means of some specific hut arbitrary rule (for example. choose the least value 01' I; from among such It values") and operation continues as described below for transmission of ak)\ source symbols x x, x in code C with code-instruction word preceding.

If expression (25) or expression (27) fail to be satisfied before a value of k can be found as above described, comparator 8 determines whether or not the expression is satisfied. If the expression (31) is satisfied, operation continues as described below for transmission of al -A source symbols x,, x, x, in code C; with no code-instruction word preceding; otherwise operation continues as described below for transmission of li -7t source symbols x x,, :c in code C with code-instruction word preceding.

When a code has been selected by comparator control 8 the flow of input symbols from input symbol index 33 is halted by a signal applied via conductor 31 and a signal is applied via conductor 32 to input buffer 4 so that it commences re-filling and shifting out all source symbols which have been encoded by the encoder corresponding to the selected code. The number of source symbols to be thus shifted is determined by the count in the input marking register corresponding to the selected code. The count of the output marking counter corresponding to the selected code is noted by storage in comparator control 8, whereupon a sequence of shift commands is sent by said comparator control via conductor 40 to simultaneously cause the output buffers BUF BUF, BUF BUF to shift and the output marking counters TC TC TC TC to increment, and the commands are continued until the count in the output marking counter and the output buffer capacity A corresponding to the selected code are equal, as determined by the comparator control 8. Thus when the said shift commands cease, the first output symbol produced by the selected encoder during the current decision interval appears at the end of the corresponding output buffer. An indication of the code selected by comparator 8 is sent to output formatting system 15 via conductor 26, and another indication is sent via that one of conductors 1"" k"" 11"" corresponding to the code selected by comparator 8 to enable the output before corresponding to the selected code to apply its contents to output formatting system 15 via the appropriate one of conductors 0, l k n.

Referring to FIG. 4A, the shift register 12 receives the contents of the selected output buffer. For transmission of output symbols with no code-instruction word preceding, a signal is applied via conductor 24 to set output position switch 22 to alternate output position 21. The count previously noted in comparator control 8 of the output marking counter in FIG. 4 corresponding to the selected code is used by the said comparator control in FIG. 4 to determine the number of shift commands that are applied via conductor to remove output symbols from shift register 12 and to apply said output symbols via conductor to the transmitter.

For transmission of output symbols with code-instruction word preceding, a signal is applied via conductor 24' to set output position switch 22 to standard output position 20. A strobe signal is applied via conductor 14' to code name generator 16 so that it applies the codeinstruction word corresponding to the selected code to shift register 12 via conductors 18. Shift commands are applied via conductor 25' to shift register 12 to remove the codeinstruction word and output symbols from shift register 12 and to apply same to the transmitter via conductor 30.

Referring to FIG. 4, the input symbol index and all coders, input marking registers, output marking counters and output buffers are cleared or reset by a signal applied via conductor 37. From this time on, all coders are again started with this point as the new effective origin as discussed in connection with the graph of FIG. 3.

The set of possible codes of encoders C C C moreover, is designed such that the set of their output words for any possible input never contains, either as a word or as a prefix of a word, the uniquely-decipherable word that is used as a code-switch instruction word at 16. This can be done by design in all coders save the null coder C For C as is shown in FIG. 4, an or gate, labelled OR, may be connected in the output line to output buffer BUF ordinarily to pass the output of null Coder C to buffer BUF If the uniquely-decipherable word is stored as a sequence of fixed voltages at F then the detection of the uniquely-decipherable word at the output buffer BUF will cause the comparator circuit C, also fed by the circuit F to activate a symbol generator F to apply a supplemental set of symbols, denoting the code name for the null encoder C sufficiently rapidly that no other symbol meanwhile emerges from encoder C through the OR gate to the buffer BUF The receiver. in the C position, receiving the uniquely-decipherable word followed by the code name for encoder C will thus not regard the said word as a tagging word. It will remain in the C mode while utilizing the uniquelydecipherable word as the information sequence that it properly represents. In view of the low probability of occurrence of the above, the occasional supplemental introduction of the C code name does not materially affect the efficiency of the system.

It will be readily apparent to those skilled in the art that the coding system of FIGS. 4 and 4A can, at the cost of some added complexity, be made more efiicient as would be the case, for example, if the discrimination level in the code selection logic were changed from 2H to H, as before described, and in other Ways; and that the apparatus of FIGS. 4 and 4A can be simplified without affecting the method of production of the novel results of this invention as, for example, in the case when the source sequence and the encoded sequence are composed of symbols drawn from a common alphabet. in which case the output sequence from the null encoder C is identical with the input sequence and the output buffer BUF as well as the input marking register SC and the output marking counter TC (whose count always equals the number stored in 5C all become unnecessary, since their contents are available respectively in the input buffer and in the input symbol counter. It will also be apparent that a reduction in equipment complexity can, in some cases, be obtained at little cost in coding efficiency, by making the code selection decision on the basis of a fixed number of input symbols rather than basing it on a variable number, as is the effect of the decision rules previously described in connection with FIG. 4. One useful set of code selection rules based on a fixed number of in put symbols is described, for example, in connection with the apparatus of FIGS. 5, 5A and 5B; and many other variations of the method and apparatus of FIG. 4 are possible.

The signals transmitted at 30 with any desired communication technique are received at 200 in FIG. 4B, there thus being provided at the receiving system the transmitted code-symbols containing the uniquely-decipherable code-switching word followed by the code name. The latter allows the receiver to switch the incoming sequence to that decoder which is appropriate to undo the transmitter coding. The terms communication" and transmitting as herein employed are intended, moreover, to embrace not only such operations as propagation along lines, radio, sound, light or other links, but also passage to storage, such as magnetic, optical or other memory systems, or other utilization apparatus. In the event of transmission to storage, it is the storage capacity rather than the time-bandwidth product of transmission, of course, that is e'conomized.

The decoding logic treats the symbols received from the encoder system of FIG. 4 in such a fashion as to reconstruct the original symbol sequence which was encoded. This is accomplished by having logical operations determine the means of coding used by the transmitter and the times at which the transmitter has changed its method of transmission. With this information, the proper decoder is selected to reconstruct the original source sequence.

With specific reference to the embodiment of FIG. 4B, the symbols received at 200 are stored in an input buffer register 201 and they are also fed at 20-0 to be counted by a symbol counter 202 to generate a completion pulse at output 203 when a specified number of symbols has been received. A detector for monitoring the reception of the uniquely-decipherable Word representing a code-switching instruction is provided at 204, labelled U.D. Word Detector, and is connected at 210 to the outputs of the input buffer register 201.

Assume that the machine is operating in some arbitrary mode. When the uniquely-decipherable word detector 204 detects the uniquely-decipherable code-switch instruction word, a pulse is transmitted along conduc tor 204' to decoders D, D to notify each decoder that the uniquely-decipherable word has been detected and that this word is not to be considered by these decoders as being a part of a legitimate message sequence; hence D D will use only the symbols currently stored in them to do the decoding. If the mode decoder 205 notifies the U.D. Word Detector 204 via conductor 206' that the current mode is the C mode, a D mode detector 213 is activated via conductor 212 upon notice of detection of the uniquely'decipherable word. If the D mode detector 213 determines, from its input along conductors 214, that the symbols in the input buffer register 201 following the uniquely-decipherable word are not the symbols denoting the C mode, a pulse is emitted to the D decoder via conductor 216 to notify the D decoder to discontinue taking symbols from the input butter register 201, as is done for the decoders D, D above described. It, on the other hand, the D mode detector finds that the symbols do denote the C mode, no pulse is emitted on 216 and the D decoder uses the symbols denoting the uniquely-decipherable word as proper symbols for decoding; simultaneously, the extra symbols representing the C mode are removed via conductor 207, thus keeping the D decoder working on the proper steady stream of symbols. If the pulse is emitted via conductor 216, a pulse is also transmitted via conductor 217 to notify the symbol counter 202 that the uniquely-decipherable word has been detected and that the counter 202 should proceed to count the symbols constituting the uniquely-decipherable word. When the previous mode was not C the uniquely-decipherahle word detector 204 transmits a pulse via conductor 205 similarly to notify the counter 202. At the end of this count, mode decoder 206 is notified by way of conductor 203, to admit the following symbols denoting the code name representative of the encoder selected at the transmitter. Depending upon the resulting storage in mode decoder 206, the appropriate decoder and buffer circuit D D D (corresponding to respective encoders C C C at the transmitter) will be selected as shortly described, to connect the output of the proper decoder to the decoded symbol output line 230 and thus permit the proper decoding of the symbols received in the input buffer register 201.

Using the decoded information concerning which mode is operative. upon the completion of the said word count in the counter 202, the mode decoder 206 will activate the appropriate decoder-buffer D D D to cause the thusly selected decoder-buffer to store input symbols and to produce a stream of output symbols which constitute the decoded message. Such buffer-decoder operates autonomously after being selected and connected to the input buffer.

The receiver always begins operation as if the initial transmission were to he in the code; that is, the modedecoder 206 is initially in the state corresponding to de- 16 coding by decoder-buffer D and the said mode-decoder will persist in that state until a uniquely-decipherable code-switching instruction word followed by code name symbols other than those corresponding to C are received.

The detectors of the unit 204 may, for example, be of the comparator type described in connection with elements 8 and C in FIG. 4; the input buffer register 211 may be of the type employed in the output buffers BUF BUF, etc., of FIG. 4; the mode decoder 206 may assume the form described on pages 2.15 through 2.17 of the said System Modules text; and the decoders D D etc., may be of the type described in the patents and publications previously mentioned in connection with the encoders of FIG. 4. Clearly, other types of well-known circuits and apparatus may also similarly be used.

One of the important features of the method underlying the present invention involves the explicit determination of the transmission cost incurred in sending the current portion of the source sequence by each of a variety of codes, and at each instant, the choosing of the most efficient code. Just how the transmission cost is determined is immaterial, so long as the determination is based on actual performance. The method of determining cost presented above envisages the actual construction and operation of a set of coders, and the counting of output symbols therefrom. It would be equally valid to have a special computer which accepts the input sequence and determines the count of output symbols, or other measure of actual performance, by simulating the various coders, or by making use of known algebraic relations between input sequences and output symbol counts, or other measure of performance, to determine the latter. Under certain conditions, as in the example that follows, the second approach requires less equipment. This computed evaluation and simulation of the various encoders, however, serves as and is fully equivalent to the actual use of a separate plurality or set of encoders and is so treated in this specification and is so intended in the language used in the claims relating to the pluralities of codes, encoders and decoders.

For some types of communication, a single kind of code can, merely through changes in certain characteristic parameter values, be made to fit all the populations that a given source can produce. An example is black-andwhite facsimile transmission, for whose populations runlength coding is indicated. A particularly practical form of run-length coding, because it requires a minimum of equipment, is that which results in words of fixed length; i.e., at each transition from black to white, or vice versa, the transmitter sends a word representative of the number of steps it traversed in going from the previous transition to the present one. Since all words have the same number of symbols, the receiver can unambiguously break up the continuous stream of incoming symbols into discrete words. Because, however, each word has a fixed finite length, it cannot describe an arbitrarily large distance between transitions in the input copy. If, indeed, a word consists of N symbols chosen from an alphabet of A members, the word can describe any distance between 1 and A, but no more. A six-symbol binary word, for example, can describe all dis ances between 1 and 2. Since transitions will sometimes be farther apart than this maximal run, a word must also be transmitted at the end of each maximal run to re-start the count. Sending these words is inefficient, and it is desirable that there be as few as possible. This can be done by choosing fixed-length words containing many symbols, so that they can accommodate very long maximal runs. But then each legitimate transition also costs many symbols, and it there are many transitions, this grows inefiicient (while at the same time the probability of very long runs grows smaller).

The length of the fixed-length word, therefore, should be chosen greater or smaller, depending on the current density of transitions in the input sequence. If the apparatus is set up to transmit fixed-length words of, say, eight different lengths, and if a particular sequence is in the input buffer, it is easy to count how many transitions occur in the sequence and also how many transitionless maximal runs occur for each of the chosen lengths of fixed-length word. Given the input sequence, it is just as easy to compute how many output symbols each of the possible codes will produce as it is to construct the actual encoders and count their outputs. For this case, it is less expensive, in terms of equipment, to compute.

When one scans documents for facsimile transmission, for exam le, some lines contain many transitions from black to white, others contain few, and still others have transitions very rarely or never. In this case, instead of having several (perhaps eight) different encoders C C etc., each of which is a run-length coder, it clearly is more economical to take the source sequence (the scanner lines arranged end-to-end in time), count the transitions and the number of maximal runs (and store the sequence itself), then use this count in an algorithm which, by calculation rather than by simulation, determines the best code to use at any given time. Since the only free variable or parameter is the length of the best fixedlength word, the computer determines this number by implementing the code-switching logic described earlier, and then, having determined the best parameter values, the computer adjusts a single run-length encoder accordingly. The encoder, which is now optimized for the source sequence in storage, or the initial portion thereof, is now fed the source sequence until the computer decides that it is time to switch the run-length code parameter to a new value. Every time the code parameter is changed, an instruction word is sent to the receiver telling it the new value of the code parameter.

A successful simple version of a coder with such codeswitching logic, that exhibits all the important features and advantages of the system of FIGS. 4, 4A and 4B, has been constructed in conjunction with a facsimile system for the transmission of black-and-white graphical material, with startling compression factors, and is schematically presented in FIGS. 5 and 5A.

The basic operation of the coded facsimile transmission apparatus of FIG. 5 is as follows. Using a cathode ray tube scanner 61, the machine causes the input copy (picture, drawing, document, or the like) to be examined in a line-by-line fashion, in much the same fashion as a television scan, but using cathoderay deflection controlled by digital counters which may be stopped and started on command. If a line is scanned and found to be free of edges (edges are black-to-while or white-to-black transitions, as determined by video quantization and Boolean logic), a special word is transmitted, along with a uniquely-decipherable sync word to state that this line was blank. A properly constructed receiver understands these as well as other coded messages and uses the information to construct a facsimile of the original input. A line may also be found to have a non-zero number of edges. In this case, the machine selects one of several code algorithms, depending on which is optimum for the particular number of edges measured during the preliminary scan. A Word is transmitted, for each line of scan in the present embodiment, along with the unique sync word which denotes the encoding procedure used to transmit the video information contained in the line. The line is scanned again during the transmission so as to use the input source itself as the information buffer.

With specific reference to FIG. 5, the operation of the machine is initiated by pushing a start button 50, causing a clock pulse generator 51 (as of the type described on pages 275-6 of Digital Modules (A705A), published 1962 by the said Digital Equipment Corpration) to emit a pulse train that is divided by a factor n in a divider 72,

such as, for example, divider circuits of the type described on page 6.22 of the said System Modules text. The divided pulse train is applied at 52 to a word-length counter comparator 52 (similar to the comparator circuit 8 of FIG. 4, for example) to transmit word pulses at 53 to coincidence gates 54, causing a search flip-flop 55 to enable an AND gate 56 and to allow pulses to be distributed via an OR gate 57 and conductor 57' to the runlength counter 76. The output of the OR gate 57 also feeds a pulse generator 58 to generate intensifier pulses applied by way of conductor 58' to the cathode-ray-tube scanner 61 to provide light in the scanner 61 to scan the desired copy. The scanner 61 may be of any desired type such as, for example, the type described on pages 402-3 of the said Digital Modules text. The pulse generator 58 also supplies input at 58" to the horizontal sweep counter 59, which count is converted into a cathode-ray-tube deflection or sweep signal by a digital-to-analog converter 60 as of, for example, the type described on pages 9.23- 9.25 of the System Modules text.

A photomultiplier 61 receiving the light from the scanned copy, with its appropriate video quantizer produces video pulses that are applied at 62 to edge gates 63 where logical decisions (AND or OR) are made to determine when and if black-to-white or white-to-black transitions occur. The occurrence of edges is counted by an edge counter 64 whose output is compared with stored threshold values. Whenever a coincidence of number of edges and these stored values occurs, the threshold comparators 65 emit a pulse which is counted by an encoder selector counter 66. The contents of the encoder selector counter 66 is fed to an encoder selector buffer 67 via conductors 66 when the horizontal sweep counter 59 reaches a preset full count (i.e., end of horizontal scan), under the control of a pulse from the counter 59 via conductor 68 to the buffer 67.

While the search sweep and edge determination measurement is proceeding, the initialized encoder selector buffer 67 has allowed coincidence gates 54 to produce a pulse at 69, causing the sync word storage at 69' to be transferred to the output shift register 70, inserting the before-described uniquelynecipherable word. The output shift register 70, during the transmission, is shifted by pulses at 71 from the clock pulse generator 51, divided by a suitable constant :1 at 72, depending upon the code and transmission line parameters. The coincidence gates 54, and a level set from the encoder selector counter 66 at gates 73, cause the appropriate word to be stored in the output shift register to denote the encoding method or code which has been selected. If there were no edges, the coincidence gates 54 would cause the vertical sweep counter 74' to advance one count by feeding thereto a pulse at 74, simultaneously resetting the edge counter 64 at 74" for the next search scan.

A blank line is reproduced at the receiver by decoding the Word sent to denote the encoding method which was selected. If edges were encountered, the coincidence gates 54 would not cause the vertical counter 74 to advance, but would, at the proper word time as determined by the word length counter-comparator 52, set a code flip-flop 75 to allow pulses to pass through OR gate 57, with the subsequent operations described above. When an edge is not encountered, however, before the run-length counter 76 and coincidence gates 77 denote reaching of a full count (the full count length depending on the type of code selected), a pulse at 78 will reset the code flip-flop 75 and stop the pulse flow through 57. At the appropriate word time, a word is transmitted by a pulse at 84 from gates 83, conditioned by a word pulse from the comparator 52 along conductor 52" and enabling level from the buffer 67. This word serves to tell the receiver that there is some distance to cover before an edge is encountered. When an edge is encountered, the coincidence of an enabling level at 79 and edge pulse at 80 in gate 81 causes a pulse at 82 to reset the code flip-flop 75, stopping the pulse flow 19 through the OR gate 57. Again, at the appropriate time, a pulse at 84 causes an output word. this word describing the distance and kind of edge from the last space or edge word transmitted.

The remainder of the video edge information is transmitted in this fashion until the full horizontal scan count is reached which serves to start another search cycle at the appropriate time. The full horizontal sweep count pulse at 87 at this time resets all appropriate flip-flops and other circuits and causes, by appropriate coincidence in gate 85, the encoder selector buffer 67 to be reset to an appropriate value for the next horizontal-line scan operation. If the code selected is the uncoded or null" code, the pulse rate passed by uncodcd flip-flop 86 (set by coincidence gates 54) to the OR gate 57, is at the divide-by-n rate so as to produce video information at the rate required by the transmission line. When the last horizontal line has been transmitted, the end of picture pulse at 88 stops the clock pulse generator 51, leaving the machine ready for the next picture transmission.

if desired, a memory circuit buffer 300 may be connected to the horizontal sweep counter 59, as in FIG. 58, to store the count at the time of the occurrence of the last black-to-white or white-to'black transition detected during the search scan and to stop the encoding during transmission when a last edge comparator 301 indicates equality with the current output of the horizontal sweep counter 59. so that no time is wasted with the rest of the line. Thus, each edge pulse at the gate 63 can so instruct the horizontal sweep counter to avoid transmission of blank line portions, producing an output pulse from an AND gate 302, connected also with the output of the code flipflop 75, to produce the same functional control at the search flip-flop 55, the code flip-flop 75, the uncoded fliptiop 86 and the gate as is effected by conductor 87 in the system of FIG. 5. for resetting at full count. This, of course, does not modify the receiving operation since the receiver starts a new line each time it receives the uniquely-decipherable sync word, but it further increases the efficiency of the system of FIG. 5.

The output shift register transmits the coded symbols to a line modulator that, through any desired type of communication link, transmits to the receiving system.

The receiver mechanism of FIG. 5A is designed for the reconstruction of the facsimile transmission of the coded variety described in connection with FIG. 5. The receiver uses. for example. a cathode-ray tube 140 With appropri ate amplifiers and logic to produce a facsimile of the original on a light-sensitive material or any other reproducing device.

As a general description. assume the receiver is waiting for a transmission to commence. Certain pulses keep a synchronism between the logic of the machine and the input over the line so that when a unique sync word appears, the machine is able to interpret it as such and to prepare its internal logic for the following operations. Upon receipt of the sync word, such as the uniquelydccipherable code-switching instructional Word, certain *bits" are investigated to determine the proper mode of reception. When this is done, the bits are interpreted in M bit words." where M is a variable depending on the chosen code. The words. in turn. inform the receiver as to where to place white and black on the reproduction so as to produce a facsimile copy. The exposures are made in a line-hy-line fashion to reproduce as an output copy the scanned picture which the transmitter has seen.

With reference to FIG. 5A, the detailed behavior of the receiving apparatus may be understood as follows. A clock provides the pulses necessary for the higher speed computations and functions of the machine. The receiver demodulator 101 provides synchronizing pulses along from the transmission line. and it provides message symbols from the line. These information bits are fed at 106 into an input register 102 which is shifted at the line hit rate (the line has all ls or all Os between transmissions), under the control of synchronizing pulses applied along 105 and conductor 105'.

The sync detector 103 (logical AND circuit) transmits a pulse along 104 to reset the word length counter when the uniquely-decipherable sync word is encountered. After the bits denoting the following code are fully in position in the input register 102 (determined by counting a predetermined number of line pulses by the word length counter 110), the contents of the input register 102 are transferred into the input buffer 125. This serves as a temporary storage. The word is then stored in mode storage circuit 126. where the information is used to determine the means of further decoding. If the mode is determined to be the mode code denoting a blank line, the mode name" line 107 connected to the mode storage circuit 126 applies a pulse to cause the vertical counter 132 to be advanced and the input shift register is shifted while the machine waits for the next sync word. If the mode word calls for a coded transmission, the word length counter 110 counts the number of bits to be used per word, based on the mode in use. The decoding of the words is done by transferring them into the input buffer at appropriate times where a comparison can be made between the run-length counter 128 and the input buffer 125 by a logical comparison circuit 129. This comparator circuit 129 serves the purpose of allowing the horizontal counter to advance only as far as the words specify. The horizontal advance pulses at 109 have passed through OR circuit 111 from the AND circuit 112 which is conditioned by clock pulses from clock pulse generator 100 and the coded run flip-flop 113, and trigger a pulse gen erator 111 for producing horizontal advance and intensifier pulses, later described. Run flip-flop 113 is started whenever a new word is read into input buffer 125 denoting a new word (unless the word is the uniquely-decipherable sync instruction word, in which case the run flipilop 113 and uncoded run fiip-fiop 115 are inhibited by the sync word on line 114). Run flip-flop 115 is started by code name line 107 when the name reads uncoded," and is stopped by completion of horizontal line count as on line 116. Run flip-flop 115 controls passage of pulses through AND circuit 117 into OR circuit 111 for subsequent horizontal count advancement at the uncoded rate equal to the line hit rate. Part of the word is decoded by video decoder 131 to produce the white or black intensities, as required, when supplied with the beforementioned intensifier pulses via conductor 127.

The decoding of words of length M continues until a sync word is received; at which time, the vertical counter 132 is advanced and a new sequence of operations occurs, as above. Both the horizontal counter 130 and the vertical counter 132 are connected to respective digitalto-analog converters 133 and 134 which deflect the cathode-ray display (or control whatever other reproduccr is employed) to produce the scanning. Delay unit 118 resets the counters 130 and 132 upon receipt of the first sync pulse in a transmission to provide frame-sync. Further, delay 118 also starts the clock pulse generator 100 (or other required external logic or equipment) at the beginning of each transmission; the turn-off or stop of such devices being accomplished by picture completion pulses from the vertical counter 132 upon reaching a complete count via line 120.

0 FIGS. 5 and 5A is a direct embodiment of the general system of HUS. 4, 4A and 4B. and there is no logical difference between the same and such general system.

Further modifications, including other specific applications of the general coding method underlying the inven. tion will occur to those skilled in the art; and all such are.

considered to fall within the spirit and scope of the invention as defined in the appended claims.

What is claimed is:

1, Communication apparatus having, in combination, means for accepting message symbols, means operable as successive message symbols are accepted for determining from a plurality of predetermined codes the particular code that produces the smallest number of symbols of coded representation thereof consistent with distortionless message transmission, encoder means connected to the accepting means and adapted to encode in any one of the predetermined codes, decision means operable when the determining means indicates a saving by using a different code for thereupon selecting such different code and causing the encoder means to encode in such different code, and means for transmitting the selected coded symbols.

2. Apparatus as claimed in claim 1 and in which means is provided responsive to the operation of the decision means for transmitting tagging symbols identifying the selected code.

3. Apparatus as claimed in claim 2 and in which means is provided for generating a uniquely-decipherable codeswitching instruction word prior to the transmission of the said tagging symbols identifying the selected code.

4. Apparatus as claimed in claim 1 and in which storing means is provided for storing a group of message symbols prior to the code selection by the said decision means to enable determination of the said selected code.

5. Communication apparatus having, in combination, means for accepting message symbols, means operable as successive message symbols are accepted for determining from a plurality of predetermined codes the particular code that produces the smallest number of symbols of coded representation thereof consistent with distortionless message transmission, encoder means connected to the accepting means and adapted to encode in any one of the predetermined codes, decision means operable when the determining means indicates a saving by using a different code for thereupon selecting such different code and causing the encoder means to encode in such different code, means for transmitting the selected coded symbols, means for receiving the transmitted coded symbols and determining the predetermined selected code thereof, and decoding means connected with and responsive to the lastnamed means for reconstructing from the transmitted coded symbols the original message symbols.

6. Communication apparatus having, in combination, means for accepting message symbols, means operable as successive message symbols are accepted for determining from a plurality of predetermined codes the particular code that produces the smallest number of symbols of coded representation thereof consistent with distortionless message transmission, encoder means connected to the accepting means and adapted to encode any one of the predetermined codes, decision means operable when the determining means indicates a saving by using a different code for thereupon selecting such different code and causing the encoder means to encode in such different code, means for transmitting the selected coded symbols, means responsive to the operation of the decision means for transmitting tagging symbols identifying the selected code, means for receiving the transmitted coded symbols and determining from the tagging symbols the predetermined selected code thereof, and decoding means connected with and responsive to the last-named means for reconstructing from the transmitted code symbols the original message symbols.

7. Communication apparatus having, in combination, means for accepting message symbols, encoder means serving as a plurality of encoders each connected to the accepting means and adapted to encode in a different predetermined code, counter means serving as a corresponding plurality of counters, one connected with each encoder, for counting the numbers of symbols of coded representations of successive message symbols, comparator Cir :2 means for comparing the said numbers to determine the particular code that introduces the smallest number of symbols of said coded representation consistent with distortionless message transmission, decision mean operable when the comparator means indicates a saving by using a different code for thereupon selecting the corresponding encoder output, and means for transmitting the encoded symbols from the said selected encoder output.

8. Communications apparatus having, in combination, means for accepting message symbols, encoder means serving as a plurality of encoders each connected to the accepting means and adapted to encode in a different predetermined code, one of the plurality of encoders being a null encoder that reproduces in its output the original message symbols substantially without change, counter means serving as a corresponding plurality of counters, one connected with each encoder, for counting the numbers of symbols of coded representations of successive message symbols, comparator means for comparing the said numbers with the null encoder output to determine the particular code, if any, that introduces the smallest number of symbols of said coded representation consistent with distortionless message transmission, decision means operable when the comparator means indicates a saving by using a different code for thereupon selecting the corresponding encoder output, and means for transmitting the encoder symbols from the said selected en coder output.

9. Apparatus as claimed in claim 7 and in which input buffer means is provided between the accepting means and the encoder means for enabling the resetting of the apparatus after diffc rent encoder selections.

10. Apparatus as claimed in claim 7 and in which output buffer means is provided connected between encoder and the transmitting means, for storing the encoded symbols prior to transmission thereof.

11. Communication apparatus having, in combination, means for accepting message symbols, encoder means serving as a plurality of encoders each connected to the accepting means and adapted to encode in a different pre determined code, counter means serving as a corresponding plurality of counters, one connected with each encoder, for counting the numbers of symbols of coded representations of successive message symbols, comparator means for comparing the said numbers to determine the particular code that introduces the smallest number of symbols of said coded representation consistent with distortionless message transmission. decision means operable when the comparator means indicates a saving by using a different code for thereupon selecting the corresponding encoder output, means for transmitting the encoded symbols from the said selected encoder out put, means for receiving the transmitted coded symbols and determining the predetermined selected code thereof, and decoding means connected with and responsive to the last-namcd means for reconstructing from the trans mitted coded symbols the original message symbols.

[2. Communication apparatus having, in combination, means for accepting message symbols, encoder means serving as a plurality of encoders each connected to the accepting means and adapted to encode in a different predetermined code, counter means serving as a corresponding plurality of counters, one connected with each encoder, for counting the numbers of symbols of coded representations of successive message symbols, comparator means for comparing the said numbers to determine the particular code that introduces the smallest number of symbols of said coded representation consistent with distortionless message transmission, decision means operable when the comparator means indicates a saving by using a different code for thereupon selecting the corresponding encoder output, means for transmitting the encoded symbols from the said selected encoder output, means responsive to the operation of the decision means for transmitting tagging symbols identifying the selected code, means for receiving the transmitted coded symbols and determining from the tagging symbols the predetermined selected code thereof, and decoding means connected with and responsive to the last-named means for reconstructing from the transmitted coded symbols the original message symbols.

13. Apparatus as claimed in claim 7 and in which means is provided responsive to the operation of the decision means for transmitting tagging symbols identifying the selected code.

14. Apparatus as claimed in claim 13 and in which means is provided for transmitting a uniquely-decipherable code-switching instruction word prior to the transmission of the tagging symbols identifying the selected code.

15. Apparatus as claimed in claim 14 and in which none of the codes of the encoder means produces the said uniquely deeipherable word.

16. Apparatus as claimed in claim 8 and in which none of the codes of the encoder means produces the said uniquely decipherable word and means is provided for rapidly transmitting a tagging symbol specially identifying the null encoder upon receipt of such uniquely decipherable word to indicate continued operation in the null encoder mode.

17. Apparatus as claimed in claim 1 and in which the sequence of operation is substantially as set forth in the outline herein entitled Coder Logic When Discriminant Equals H.

18. Apparatus as claimed in claim 1 and in which the sequence of operation is substantially as set forth in the outline herein entitled Coder Logic When Discriminant Equals 2H.

19. Apparatus as claimed in claim 7 and in which the encoder and counter means comprise actual corresponding pluralities of encoders and counters.

20. Apparatus as claimed in claim 19 and in which there is provided a plurality of output butters, on connected between each encoder and the transmitting means, for storing the encoded symbols prior to transmission thereof.

21 Communication apparatus having, in combination, means for accepting a plurality of message symbols, counter means operable as successive symbols are accepted for counting the numbers of the same, comparator means having a plurality of predetermined thresholds corresponding to predetermined codes and connected to the counter means to determine the particular code that produces the smallest number of symbols of coded representation of the message symbols consistent with distortionless transmission, encoder means adapted to encode in a plurality of diflerent codes, and decision means operable when the comparator means indicates a final predetermined threshold for causing the encoder means to encode the symbols in the corresponding particular code, and means for transmitting the encoded symbols.

22. Apparatus as claimed in claim 21 and in which the encoder means comprises means for producing a plurality of different run-length codes and the decision means, when operated, selects the run-length code corresponding to the said final predetermined threshold.

23. Apparatus as claimed in claim 21 and in which means is provided responsive to the operation of the decision means for transmitting tagging symbols identifying the selected code.

24. Apparatus as claimed in claim 23 and in which means is provided for generating a uniquely dccipherable code-switching instruction word prior to the transmission of the said tagging symbols identifying the selected code.

25. Communication apparatus having. in combination, means for accepting a plurality of message symbols, counter means operable as successive symbols are accepted for counting the numbers of the same, comparator means having a plurality of predetermined thresholds corresponding to predetermined codes and connected to the counter means to determine the particular code that produces the smallest number of symbols of coded representation of the message symbols consistent with distortionless transmission, encoder means adapted to encode in a plurality of different codes, decision means operable when the comparator means indicates a final predetermined threshold for causing the encoder means to encode the symbols in the corresponding particular code, means for transmitting the encoded symbols, means for receiving the transmitted coded symbols and determining the predetermined selected code thereof, and decoding means connected with and responsive to the last-named means for reconstructing from the transmitted coded symbols the original message symbols.

26. Communication apparatus having, in combination, means for accepting a plurality of message symbols, counter means operable as successive symbols are accepted for counting the numbers of the same, comparator means having a plurality of predetermined thresholds corresponding to predetermined codes and connected to the counter means to determine the particular code that produces the smallest number of symbols of coded representation of the message symbols consistent with distortionless transmission, encoder means adapted to encode in a plurality of different codes, decision means operable when the comparator means indicates a final predetermined threshold for causing the encoder means to encode the symbols in th corresponding particular code, means for transmitting the encoded symbols, means responsive to the operation of the decision means for transmitting tagging symbols identifying the selected code, means for receiving the transmitted coded symbols and determining from the tagging symbols the predetermined selected code thereof, and decoding means connected with and responsive to the last-named means for reconstructing from the transmitted coded symbols the original message symbols.

27. Apparatus as claimed in claim 21 and in which means is provided for preliminarily scanning each successive line of a picture and the like and generating a count of the transitions between black and white portions thereof along such line, and means for thereupon re-scanning each successive line to generate the said message symbols.

28. Apparatus as claimed in claim 27 and in which the comparator means during such preliminary scanning selects a code algorithm depending upon the optimum code for the number of transitions in such lin counted during such preliminary scan by the scanning means.

29. Apparatus as claimed in claim 28 and in which means is provided responsive to the count during the said preliminary scan for transmitting a uniquely decipherable code-switching instruction word and a tagging symbol identifying the selected code prior to the transmission of the properly coded message symbols resulting from the encoding of the symbols produced during the said rescanning.

30. Apparatus as claimed in claim 28 and in which the scanning means comprises a cathode-ray-tube device.

31. Apparatus as claimed in claim 29 and in which there is provided means for receiving the transmitted coded symbols and determining the predetermined selected code thereof, and decoding means connected with and responsive to the last-named means for reconstructing from the transmitted coded symbols the original message symbols.

32. Apparatus as claimed in claim 29 and in which there is provided means responsive to the operation of the decision means for transmitting tagging symbols identifying the selected code, means for receiving the transmitted coded symbols and determining from the tagging symbols the predetermined selected code thereof, and decoding means connected with and responsive to the lastnamed means for reconstructing from the transmitted coded symbols the original message symbols.

33. Apparatus as claimed in claim 27 and in which 

